#define _CRT_SECURE_NO_WARNINGS	

typedef struct ListNode ListNode;
struct ListNode* reverseList(struct ListNode* head)
{
    ListNode* newhead = NULL;
    ListNode* pcur = head;
    ListNode* tmp;
    while (pcur)
    {
        tmp = pcur->next;
        pcur->next = newhead;
        newhead = pcur;
        pcur = tmp;
    }
    return newhead;
}